package com.ctgu.service;

import com.ctgu.dao.SupplierMapper;
import com.ctgu.entity.Supplier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SupplierServiceImpl implements SupplierService{


    @Autowired
    private SupplierMapper supplierMapper;

    public void setSupplierMapper(SupplierMapper supplierMapper) {
        this.supplierMapper = supplierMapper;
    }

    @Override
    public Integer addSupplier(Supplier supplier) {
        return supplierMapper.addSupplier(supplier);
    }

    @Override
    public Integer deleteSupplierById(Integer id) {
        return supplierMapper.deleteSupplierById(id);
    }

    @Override
    public Integer updateSupplier(Supplier supplier) {
        return supplierMapper.updateSupplier(supplier);
    }

    @Override
    public List<Supplier> getAllSupplierList() {
        return supplierMapper.getAllSupplierList();
    }

    @Override
    public Supplier getSupplier(Integer id) {
        return supplierMapper.getSupplier(id);
    }

    @Override
    public List<Supplier>  querySupplierByIdName(String name) {
        return supplierMapper.querySupplierByIdName(name);
    }
}
